package com.xuecheng.content.api;

import com.xuecheng.content.model.dto.CourseTeacherDto;
import com.xuecheng.content.model.dto.SaveTeachplanDto;
import com.xuecheng.content.model.dto.TeachplanDto;
import com.xuecheng.content.model.po.CourseTeacher;
import com.xuecheng.content.service.CourseTeacherService;
import com.xuecheng.content.service.TeachplanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author cyf
 * @version 1.0
 * @description #课程教师相关接口
 * @date 2024/8/31 20:27
 **/
@Api(value = "课程教师编辑接口", tags = "课程教师编辑接口")
@RestController
public class CourseTeacherController {
    @Autowired
    CourseTeacherService courseTeacherService;

    @ApiOperation("查询教师")
    @GetMapping("/courseTeacher/list/{courseId}")
    public CourseTeacher queryCourseTeacherByCourseId(@PathVariable Long courseId) {
        return courseTeacherService.queryCourseTeacherByCourseId(courseId);
    }

    @ApiOperation("添加教师")
    @PostMapping("/courseTeacher")
    public CourseTeacher addCourseTeacher(@RequestBody CourseTeacherDto courseTeacherDto) {
        return courseTeacherService.addCourseTeacher(courseTeacherDto);
    }

    @ApiOperation("修改教师")
    @PutMapping("/courseTeacher")
    public CourseTeacher updateCourseTeacher(@RequestBody CourseTeacherDto courseTeacherDto) {
        return courseTeacherService.updateCourseTeacher(courseTeacherDto);
    }

    @ApiOperation("删除教师")
    @DeleteMapping("/courseTeacher/course/{courseId}/{teachId}")
    public void deleteCourseTeacher(@PathVariable Long courseId, @PathVariable Long teachId) {
        courseTeacherService.deleteCourseTeacher(courseId,teachId);
    }
}
